#ifndef SYS_IO_H_
#define SYS_IO_H_

#define I_READ 1
#define I_WRITE 2

#define READABLE(MODE) (MODE&I_READ)
#define WRITABLE(MODE) (MODE&I_WRITE)

#define STDINPUT 0
#define STDOUTPUT 1
#define STDERROR 2
#define CURDIR 3

#define SEEK_BEGIN 0
#define SEEK_CURRENT 1
#define SEEK_LAST 2

#define ERR_FILENAME_LONG 0
#define ERR_DIR_ABSENT 1
#define ERR_FILE_ABSENT 2

int createfile(const char* _filename, int imode);
int openfile(const char* _filename, int imode);
int readfile(int _fd, void* buffer, int len);
int writefile(int _fd, void* buffer, int len);
int seekfile(int _fd, int offset, int mode);
int closefile(int _fd);

int panic(const char* message);
int get_system_time();
#endif
